<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            height: 300px;
            width: 300px;
            display: grid;
            grid-template-columns: repeat(3,1fr);
            grid-template-rows: repeat(3,1fr);
        }
        .inner{
            width: 100px;
            height: 100px;
            box-sizing: border-box;
            border: 1px solid #000;
            text-align: center;
            line-height: 100px;
        }
        /* 跨列 */
        .inner:nth-child(1){
            grid-column-start:1;
            grid-column-end:3;
            width: 100%;
        }
        /* 跨行 */
        .inner:nth-child(5){
            grid-row-start: 2;
            grid-row-end: 4;
            height: 100%;
            grid-column: 3;
            line-height: 200px;
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="inner">1</div>
        <div class="inner">2</div>
        <div class="inner">3</div>
        <div class="inner">4</div>
        <div class="inner">5</div>
        <div class="inner">6</div>
        <div class="inner">7</div>
        <!-- <div class="inner">8</div> -->
        <!-- <div class="inner">9</div> -->
    </div>
</body>
</html>